import { getIntelligentList } from '@/api/invitation';
import crossClass from '@/utils/cross-domain.js';
import { checkActivetity } from '@/utils/checkAll';

export default (await import('vue')).default.extend({
props: ['params', 'searchVal'],
data() {
return {
tabsList: [
{
label: '全部达人',
value: '1',
name: '全部达人',
},
{
label: '视频达人',
name: '视频达人',
value: '3',
},
{
label: '直播达人',
name: '直播达人',
value: '2',
},
{
label: '图文达人',
name: '图文达人',
value: '4',
},
{
label: '橱窗达人',
name: '橱窗达人',
value: '5',
},
],
isBatchButtonDisabled: true,
activeName: '1',
tableData: [],
query: null,
sort: null,
showPopover: false,
pageObj: {
currentPage: 1,
total: 0,
},
tableLoading: true,
filtersData: {},
multipleSelection: [],
getListPage: 1,
loginAllDatas: false,
stopLodinStatus: false,
isLodinAllConter: false,
isStartLodinAllConter: false,
showIsAllConte: false,
};
},
watch: {
searchVal: {
handler(newV) {
this.query = JSON.parse(JSON.stringify(newV));
this.resetTable();
},
deep: true,
},
activeName() {
this.resetTable();
},
params: {
handler(newV) {
this.filtersData = JSON.parse(JSON.stringify(newV));
this.resetTable();
},
deep: true,
},
},
methods: {
getRowKey(row) {
// console.log('row', row);
return row.author_base.uid;
},
recoyerOyer() {
this.getListPage = 1;
this.loginAllDatas = false;
this.stopLodinStatus = false;
this.isLodinAllConter = false;
this.isStartLodinAllConter = false;
this.showIsAllConte = false;
},
PollingInspect() {
const fn = () => {
let time = setInterval(() => {
getIntelligentList(
{
page: this.pageObj.currentPage,
filters: this.filtersData,
refresh: true,
search_id: '',
type: Number(this.activeName),
},
{
// verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// msToken:
//     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
// a_bogus:
//     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
}
)
.then((res) => {
let { code } = res;
clearInterval(time);
code == 0 && this.$router.go(0);
})
.catch((err) => { });
}, 3000);
};
getIntelligentList(
{
page: this.pageObj.currentPage,
filters: this.filtersData,
refresh: true,
search_id: '',
type: Number(this.activeName),
},
{
// verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// msToken:
//     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
// a_bogus:
//     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
}
)
.then((res) => {
let { code } = res;
code == -2 && fn();
})
.catch((err) => {
console.log(err, 'err');
fn();
});
},
async jumpPage(url, row) {
console.log('row', url, row);
const crossInstance = new crossClass();
const TipsFunc = (str, url) => {
this.$confirm(str, '提示', {
confirmButtonText: '前往打开',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
window.open(url);
})
.catch((err) => { })
.finally(() => {
setTimeout(() => {
that.$router.go(0);
}, 3000);
});
};
let checkUrlOpen = await crossInstance.checkUrlOpen([
'https://buyin.jinritemai.com/dashboard', //达人广场
'https://fxg.jinritemai.com/ffa', // 抖店后台
]);
let { code, data } = checkUrlOpen;
if (code == 200) {
let douDian = data.find((item) => {
return (
item.url == 'https://fxg.jinritemai.com/ffa' && item.status == true
);
});
let darenSquare = data.find((item) => {
return (
item.url == 'https://buyin.jinritemai.com/dashboard' &&
item.status == true
);
});
if (!douDian) {
let str = '使用该功能需要打开并登录抖店';
let url = 'https://fxg.jinritemai.com/login/common?from=buyin';
TipsFunc(str, url);
crossInstance.closeListen();
return;
}
if (!darenSquare) {
let str = '使用该功能需要打开并登录达人广场';
let url = 'https://buyin.jinritemai.com/dashboard/servicehall/daren-square?previous_page_name=3&previous_page_type=4';
TipsFunc(str, url);
crossInstance.closeListen();
return;
}
crossInstance
.sendMessageForPageFunc({
id: darenSquare.id,
script: `fetch('https://buyin.jinritemai.com/connection/pc/im/account?account_type=1&account_app_id=1128&account_id=${row.author_base.uid}',{
                            method: 'GET',
                            })
                            .then((res) => {
                            return res.json()
                            })
                            .then((res) => {
                            window.postMessage({
                                    type_urs: 'wkyy-wtbg',
                                    data: res,
                                    type_page: 'pageMeat',
                                    method: 'send_message_for_page'
                                })
                            })
                        `,
})
.then((res) => {
console.log('res', res);
const { code, data } = res;
if (code == 200) {
if (data.code == 0) {
const getdfijer = data.data;
let { buyin_account_id, im_id } = getdfijer;
function splitJoint(obj) {
let arr = [];
for (let key in obj) {
arr.push(key + '=' + obj[key]);
}
return arr.length > 0 ? '?' + arr.join('&') : '';
}
let urlss = 'https://buyin.jinritemai.com/mpa/pigeonIM' +
splitJoint({
friendId: im_id,
buyinId: buyin_account_id,
pick_first_source: '达人直播主页',
previous_page_name: 3,
previous_page_type: 4,
});
window.open(urlss);
}
}
})
.catch((err) => {
window.open(url);
});
}
},
resetTable() {
if (this.loginAllDatas || this.tableLoading) {
return this.$message.warning('正在请求， 不可重复操作');
}
this.recoyerOyer();
this.pageObj.currentPage = 1;
this.getListPage = 1;
this.tableData = [];
this.scrollTop();
this.getIntelligentListFunc();
},
// continueCommunicateFunc (row) {
//     let {
//         author_base: { uid }
//     } = row
//     continueCommunicate({
//         account_id: uid,
//         account_type: 1,
//         account_app_id: 1128,
//         verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
//         fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
//         msToken:
//             'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
//         a_bogus:
//             'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
//     })
//         .then((res) => {
//             console.log(res)
//         })
//         .catch((err) => { })
// },
sortChange(column) {
let {
order, column: { label },
} = column;
if (order) {
order == 'ascending' ? (order = 0) : (order = 1);
let mappingArr = [
{
name: '粉丝数',
return: () => {
return {
sort_field: 1,
sort_type: order,
};
},
},
{
name: '销售总额',
return: () => {
return {
sort_field: 21,
sort_type: order,
};
},
},
{
name: '直播销售总额',
return: () => {
return {
sort_field: 22,
sort_type: order,
};
},
},
{
name: '视频销售总额',
return: () => {
return {
sort_field: 23,
sort_type: order,
};
},
},
{
name: '图文销售总额',
return: () => {
return {
sort_field: 24,
sort_type: order,
};
},
},
{
name: '橱窗销售总额',
return: () => {
return {
sort_field: 25,
sort_type: order,
};
},
},
{
name: '单视频销售总额',
return: () => {
return {
sort_field: 18,
sort_type: order,
};
},
},
{
name: '视频观看次数',
return: () => {
return {
sort_field: 19,
sort_type: order,
};
},
},
{
name: '场均直播销售额',
return: () => {
return {
sort_field: 14,
sort_type: order,
};
},
},
{
name: '直播观看次数',
return: () => {
return {
sort_field: 26,
sort_type: order,
};
},
},
{
name: '直播GPM',
return: () => {
return {
sort_field: 17,
sort_type: order,
};
},
},

{
name: '单图文销售额',
return: () => {
return {
sort_field: 27,
sort_type: order,
};
},
},

{
name: '图文观看次数',
return: () => {
return {
sort_field: 28,
sort_type: order,
};
},
},
{
name: '图文GPM',
return: () => {
return {
sort_field: 29,
sort_type: order,
};
},
},
{
name: '视频GPM',
return: () => {
return {
sort_field: 20,
sort_type: order,
};
},
},

{
name: '橱窗订单数',
return: () => {
return {
sort_field: 30,
sort_type: order,
};
},
},
];
let sign = mappingArr.find((item) => item.name == label);
if (sign) {
this.sort = sign.return();
}
} else {
this.sort = null;
}
this.scrollTop();
// this.getIntelligentListFunc()
},
showDrawer(row) {
if (!row) {
this.$emit(
'showDrawerFunc',
JSON.parse(JSON.stringify(this.multipleSelection))
);
} else {
this.$emit('showDrawerFunc', JSON.parse(JSON.stringify([row])));
}
},
stateReturnVal(status, value, type) {
let [a, b] = value;
if (status == 0) {
let str;
if (a == b) {
str = a;
} else if (a == 0) {
str = b;
} else if (b == 0) {
str = a;
} else {
str = `${a}-${b}`;
}
if (type == 'money') {
str = '¥' + str;
}
return str;
} else if (status == 1) {
return '达人未授权';
} else if (status == 2) {
return '-';
}
},
jumpHomepage(item) {
function splitJoint(obj) {
let arr = [];
for (let key in obj) {
arr.push(key + '=' + obj[key]);
}
return arr.length > 0 ? '?' + arr.join('&') : '';
}
let { uid } = item;
let params = {
enter_from: '1',
previous_page_name: '3,5',
previous_page_type: '4,100',
log_id: '20240802180735D2CC7FEA944F8218FD25',
search_id: '',
btm_ppre: 'a0.b0.c0.d0',
btm_pre: 'a52248.b31023.c473806.d0',
btm_show_id: '9f4ceca0-99ae-4fa5-bef7-b23ca4152fa8',
uid,
};
let url = 'https://buyin.jinritemai.com/dashboard/servicehall/daren-profile' +
splitJoint(params);
window.open(url);
},
openPage(url) {
window.open(url);
},
scrollTop() {
this.$refs.elTable.bodyWrapper.scrollTop = 0;
},
handleCurrentChange(val) {
this.pageObj.currentPage = val;
this.scrollTop();
// this.getIntelligentListFunc()
},
handleSelectionChange(e) {
console.log('eelectshebr0.132456', e);
this.multipleSelection = e;
},
commonNumFilter(num) {
if (num == 0) {
return num;
} else if (Number(num) < 10000) {
return num;
} else {
return (Number(num) / 10000).toFixed(2) + '万';
}
},
getFormager(list) {
console.log('list', list);
return list.map((item) => {
let {
author_base: { nickname, avatar, author_level, fans_num, city }, author_tag: { main_cate, high_response_rate, work_cate }, author_video: {
watching_times, all_video_num_30d, GPM_low, GPM_high, GPM_status, video_sale_low, video_sale_high, video_sale_status,
}, sale_info: {
total_sales, video_total_sales, live_total_sales, image_text_total_sales, window_total_sales,
}, author_live, author_image_text, author_window, latest_content,
} = item;
let typeParams;
let obj = {
['3']: () => {
typeParams = {
watching_times, //视频观看次数
all_video_num_30d, //视频数
GPM: {
GPM_low,
GPM_high,
GPM_status,
}, //视频GPM
video_sale: {
video_sale_low,
video_sale_high,
video_sale_status,
}, //单视频销售额
video_total_sales, //视频销售总额
latest_content,
};
},
['1']: () => {
typeParams = {
total_sales, //总销售额
video_total_sales, //视频销售额
live_total_sales, //直播销售额
image_text_total_sales, //图文销售额
window_total_sales, //橱窗销售额
};
},
['2']: () => {
typeParams = {
GPM: {
//直播GPM
GPM_high: author_live.GPM_high,
GPM_low: author_live.GPM_low,
GPM_status: author_live.GPM_status,
},
live_total_sales, //直播销售额
field_average_sales: {
//场均直播销售额
sale_high: author_live.sale_high,
sale_low: author_live.sale_low,
},
watching_times: author_live.watching_times, // 直播观看次数
all_live_num_30d: author_live.all_live_num_30d, //直播场次
};
},
['4']: () => {
let {
GPM_high, GPM_low, GPM_status, watching_times, image_text_num,
} = author_image_text;
typeParams = {
image_text_total_sales: {
//图文销售总额
sale_low: image_text_total_sales.sale_low,
sale_high: image_text_total_sales.sale_high,
sale_status: image_text_total_sales.sale_status,
},
image_text_num, //图文数
GPM: {
GPM_high,
GPM_low,
GPM_status,
}, //GPM
watching_times, //图文观看次数
singleVideo: {
sale_high: author_image_text.sale_high,
sale_low: author_image_text.sale_low,
sale_status: author_image_text.sale_status,
}, //单图文销售额
latest_content,
};
},
['5']: () => {
let author_windowObj = {};
if (item.author_window) {
let { order_low, order_high, product_num, status } = author_window;
author_windowObj = {
order: {
order_low,
order_high,
status,
}, //橱窗订单数
product_num, //橱窗出单数
};
}
typeParams = {
window_total_sales: {
//橱窗销售总额
sale_low: window_total_sales.sale_low,
sale_high: window_total_sales.sale_high,
sale_status: window_total_sales.sale_status,
},
...author_windowObj,
};
},
};
obj[this.activeName] && obj[this.activeName]();
return {
...item,
expertinfo: {
nickname,
avatar,
author_level,
main_cate,
high_response_rate,
city,
work_cate,
},
fans_num, //粉丝数
...typeParams,
};
});
},
sortFunc(list) {
list = list.sort((a) => {
return a.author_connection.im_status == 3 ? -1 : 1;
});
list = list.sort((a) => {
return [2, 4].includes(a.author_connection.im_status) ? -1 : 1;
});
list = list.sort((a) => {
return a.author_connection.im_status == 1 ? -1 : 1;
});
return list;
},
async getIntelligentListFunc(getAll, allTow) {
if ((getAll || this.getListPage === 1) &&
!allTow &&
!this.getAllDarenShatsu) {
this.getListPage = 1;
// this.tableData = []
}
const _this = this;
async function getAllPagingData(obj, params, currentPage) {
if (obj.page == 1) {
_this.$refs.elTable && _this.$refs.elTable.clearSelection();
obj.refresh = true;
} else {
obj.refresh = false;
}
let totalData = await getIntelligentList(obj, params).then((res) => {
let { data, code } = res;
if (code == 0 && data) {
return res;
}
});

return totalData;
}
this.tableLoading = true;
let obj = {
page: this.getListPage,
filters: this.filtersData,
refresh: true,
search_id: '',
type: Number(this.activeName),
query: '',
};
if (this.query) {
obj.query = this.query;
}
if (this.sort) {
obj = {
...obj,
...this.sort,
};
}
//   if (getAll) {
//     // 批量获取全部
//     // console.log('获取全部的赶火车')
//     // this.getAllInNewPages(obj)
//     // return
//     const lieyr = await getAllPagingData(obj, {}, this.pageObj.currentPage)
//     if (lieyr.code == 0) {
//       const { data } = lieyr
//       const { list, total } = data
//       this.pageObj.total = total
//       const getProMiae = []
//       function treiyrr(i) {
//         console.log('insyerinsyerinsyer', i)
//         return new Promise((resolve) => {
//           setTimeout(() => {
//             resolve(getAllPagingData(obj, {}))
//           }, i * 200)
//         })
//       }
//       let insyer = 0
//       while (obj.page * 20 < total) {
//         obj.page++
//         insyer++
//         getProMiae.push(treiyrr(insyer))
//       }
//       let listAlls = list
//       Promise.all(getProMiae).then((res) => {
//         // console.log('res++614', res)
//         res.forEach((items) => {
//           if (items.code === 0) {
//             listAlls.push(...items.data.list)
//           }
//         })
//         listAlls = listAlls.filter(
//           (item, index) =>
//             listAlls.findIndex(
//               (i) => i.author_base.aweme_id === item.author_base.aweme_id
//             ) === index
//         )
//         let forMaterList = this.getFormager(listAlls)
//         this.tableData = forMaterList
//         this.tableData = this.sortFunc(this.tableData)
//         this.isBatchButtonDisabled = !this.tableData.every(
//           (item) => item.author_connection.im_status != 1
//         )
//         this.$refs.elTable.toggleAllSelection()
//         // console.log('resd', listAlls)
//         this.loginAllDatas = false
//         this.stopLodinStatus = false
//         this.tableLoading = false
//         this.isLodinAllConter = true
//         this.isStartLodinAllConter = false
//       })
//     }
//     return
//   }
getAllPagingData(
obj,
{
// verifyFp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// fp: 'verify_lyf5ie1a_PDOUr7Op_Pdw5_4lJ2_92eo_xW2e350m34Zc',
// msToken:
//     'OBvDuaCFZsXwB6dOgKQRAgDLCSzrTD2GTm9WlEDPeppXKbKhEPDm1oamjCchiSO74ku8Qoqd8mQq4peyGIv8wNYtvYD8FjUAtvUgdRu1knLCIJJ-csvtaQ%3D%3D',
// a_bogus:
//     'O680Bfz6dEfNDD8D5VQLfY3qfG1%2FYZzl0SVkMDgbRrROX639HMTH9exY81UvqlWjNs%2FDIejjy4hbYrnQrQCJ01wfHSiq%2F2CZmyT0cMlM52vj-piruyUgrUwi-hsASeHmsv1IEQfkqwArFuRDA29cmhdWP6ZCcHhMHjDISpcG2nR%3D'
},
this.pageObj.currentPage
)
.then((res) => {
try {
let {
data: { list, total }, code,
} = res;
if (code == 0) {
this.pageObj.total = total;
list = list.filter(
(item, index) => list.findIndex(
(i) => i.author_base.aweme_id === item.author_base.aweme_id
) === index
);
console.log(obj.query, String.prototype.includes(obj.query), '44444444444444444444444444444444444');

if (list && list.length > 0) {
function hasSpaces(str) {
return str.includes(' ');
}

// 使
console.log(hasSpaces('hello world')); // 输出: true
console.log(hasSpaces('helloworld'));
let forMaterList = this.getFormager(list);
// this.multipleSelection = this.handleSelectionChange(
//   //   forMaterList.map((item) => {
//   //     return item.author_base.uid
//   //   })
//   forMaterList
// )
if (this.tableData.length) {
this.tableData.push(...forMaterList);
} else {
this.tableData = forMaterList;
}
this.tableData = this.sortFunc(this.tableData);
this.isBatchButtonDisabled = !this.tableData.every(
(item) => item.author_connection.im_status != 1
);
this.$refs.elTable.toggleAllSelection();

// console.log('total', total)
// this.$refs.elTable.toggleRowSelection(this.tableData[0])
// this.multipleSelection = this.tableData
if (getAll && this.getListPage * 20 < total) {
this.getListPage++;
//   console.log('qingq ', this.getListPage)
if (getAll && allTow && this.stopLodinStatus) {
this.loginAllDatas = false;
this.stopLodinStatus = false;
this.tableLoading = false;
return;
}
this.getIntelligentListFunc(true, true);
} else {
this.loginAllDatas = false;
this.stopLodinStatus = false;
this.tableLoading = false;
// this.isLodinAllConter = true
}
if (this.getListPage * 20 >= total) {
this.isLodinAllConter = true;
this.isStartLodinAllConter = false;
}
} else {
this.tableData = [];
}
}
// this.tableLoading = false
} catch (error) {
console.log(error);
}
})
.catch((e) => { });
},
async getAllInNewPages(obj) {
const crossInstance = new crossClass();
const TipsFunc = (str, url) => {
this.$confirm(str, '提示', {
confirmButtonText: '前往打开',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
window.open(url);
})
.catch((err) => { })
.finally(() => {
setTimeout(() => {
that.$router.go(0);
}, 3000);
});
};
let checkUrlOpen = await crossInstance.checkUrlOpen([
'https://buyin.jinritemai.com/dashboard', //达人广场
'https://fxg.jinritemai.com/ffa', // 抖店后台
]);
let { code, data } = checkUrlOpen;
if (code == 200) {
let douDian = data.find((item) => {
return (
item.url == 'https://fxg.jinritemai.com/ffa' && item.status == true
);
});
let darenSquare = data.find((item) => {
return (
item.url == 'https://buyin.jinritemai.com/dashboard' &&
item.status == true
);
});
if (!douDian) {
let str = '使用该功能需要打开并登录抖店';
let url = 'https://fxg.jinritemai.com/login/common?from=buyin';
TipsFunc(str, url);
crossInstance.closeListen();
return;
}
if (!darenSquare) {
let str = '使用该功能需要打开并登录达人广场';
let url = 'https://buyin.jinritemai.com/dashboard/servicehall/daren-square?previous_page_name=3&previous_page_type=4';
TipsFunc(str, url);
crossInstance.closeListen();
return;
}
// ;(function () {
//   let addputer = []
//   fetch(
//     'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
//     {
//       method: 'POST',
//       headers: {
//         'Content-Type': 'application/json',
//       },
//       body: JSON.stringify(obj),
//     }
//   )
//     .then((res) => {
//       return res.json()
//     })
//     .then((res) => {
//       const { code, data } = res
//       if (!res.code) {
//         const { total } = data
//         console.log('total', total)
//         data.page = 1
//         while (obj.page * 20 < total) {
//           data.page++
//           addputer.push(
//             fetch(
//               'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
//               {
//                 method: 'POST',
//                 headers: {
//                   'Content-Type': 'application/json',
//                 },
//                 body: JSON.stringify(obj),
//               }
//             ).then((res) => {
//               return res.json()
//             })
//           )
//           // getProMiae.push(getAllPagingData(obj, {}, this.pageObj.currentPage))
//         }
//         Promise.all(addputer).then((res) => {
//           window.postMessage({
//             type_urs: 'wkyy-wtbg',
//             data: res,
//             type_page: 'pageMeat',
//             method: 'send_message_for_page',
//           })
//         })
//       }
//     })
// })()
console.log('obj', JSON.stringify(obj));
crossInstance
.sendMessageForPageFunc({
id: darenSquare.id,
script: `;(function (datas) {
            let addputer = []
            console.log('data1234568798', datas)
            fetch(
                'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
                {
                method: 'POST',
                headers: {
                    'Content-Type': 'application/json',
                },
                body: JSON.stringify(datas),
                }
            )
            .then((res) => {
              return res.json()
            })
            .then((res) => {
                const { code, data } = res
              if (!res.code) {
                const { total } = data
                console.log('total', total)
                datas.page = 1
                while (datas.page * 20 < total) {
                  datas.page++
                  addputer.push(
                    fetch(
                      'https://buyin.jinritemai.com/square_pc_api/square/search_feed_author',
                      {
                        method: 'POST',
                        headers: {
                          'Content-Type': 'application/json',
                        },
                        body: JSON.stringify(datas),
                      }
                    ).then((res) => {
                      return res.json()
                    })
                  )

                  // getProMiae.push(getAllPagingData(obj, {}, this.pageObj.currentPage))
                }

                Promise.all(addputer).then((res) => {
                  window.postMessage({
                    type_urs: 'wkyy-wtbg',
                    data: res,
                    type_page: 'pageMeat',
                    method: 'send_message_for_page',
                  })
                })
              }
            })
          })(${JSON.stringify(obj)})
                        `,
})
.then((res) => {
console.log('res65498756465465', res);
})
.catch((err) => {
window.open(url);
});
}
},
cheacjer(func, ...a) {
// 先检查登录状态
// 登录完成后立马检查激活状态
if (!this.$store.state.yywk.yywktoken) {
console.log('先登录');
this.$emit('showLoginBox');
return;
}

const acstatus = checkActivetity();
if (!acstatus) {
// console.log('调用激活123456')
// this.$emit('showLoginBox')
this.$emit('showActivetBox');

return;
}
console.log('arguments', a);
// this[func]
this[func](...a);
},

getAllDarenShatsu() {
//   return
if (!this.isStartLodinAllConter) {
this.getListPage = 1;
this.tableData = [];
}
this.isStartLodinAllConter = true;
if (!this.loginAllDatas) {
this.getIntelligentListFunc(true);
this.loginAllDatas = true;
} else {
this.stopLodinStatus = true;
}
},
refoLisuehr() {
this.loginAllDatas = false;
this.stopLodinStatus = false;
this.isLodinAllConter = false;
this.isStartLodinAllConter = false;
this.showIsAllConte = false;
this.getListPage = 1;
this.tableData = [];
this.getIntelligentListFunc();
},
},
computed: {
getTabData() {
//   this.$refs.elTable && this.$refs.elTable.toggleAllSelection()
// 返回tableData 第 pageObj.currentPage 页的 20条
let reloads = this.showIsAllConte
? this.tableData.filter((item) => item.author_connection.im_status == 1)
: this.tableData; // .slice((this.pageObj.currentPage - 1) * 20, this.pageObj.currentPage * 20)

return reloads.slice(
(this.pageObj.currentPage - 1) * 20,
this.pageObj.currentPage * 20
);
//   return this.showIsAllConte
//     ? this.tableData.filter((item) => item.author_connection.im_status == 1)
//     : this.tableData // .slice((this.pageObj.currentPage - 1) * 20, this.pageObj.currentPage * 20)
},
tableDataLength() {
return this.showIsAllConte
? this.tableData.filter((item) => item.author_connection.im_status == 1)
.length
: this.tableData.length;
},
},

mounted() {
setTimeout(() => {
this.refoLisuehr();
this.PollingInspect();
}, 2000);
},
});
